package com.test.adapter;


import java.util.List;

import com.test.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ScollViewAdapter extends BaseAdapter {
	LayoutInflater layoutInflater;
	List<String> list;
	public ScollViewAdapter(Context context,List<String> list){
		this.list=list;
		layoutInflater=LayoutInflater.from(context);
	}
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		TextView tv=null;
		if(convertView==null){
			convertView=layoutInflater.inflate(R.layout.text, null);
			tv=(TextView) convertView.findViewById(R.id.textView1);
		}
		tv.setText(list.get(position));
		return convertView;
	}

}
